<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 1、lazy 失去焦点后数据同步 -->
        <input type="text" v-model.lazy="info">
        <div>{{info}}</div>

        <!-- 2、number -->
        <input type="text" v-model.number = 'info'>
        <h2>{{info}}</h2>
        <button @click="handleClick">查看类型</button>
        <br>

        <!-- 3、trim -->
        <input type="text" v-model.trim="info">
        <button @click="handleTrim">去空格</button>
    </div>
    <script src="../../js/vue.js"></script>
    <script>
        const dcl = {
            data(){
                return {
                    info: 'hello world'
                }
            },
            methods: {
                handleClick(){
                    console.log('查看输入类型:'+typeof this.info)
                },
                handleTrim(){
                    console.log(this.info)
                }
            },
        };
        Vue.createApp(dcl).mount('#app');
    </script>
</body>
</html>